package com.cskaoyan.day31.work1._04_proxy._01_static_proxy;

import com.cskaoyan.day31.work1._04_proxy._00_bean.User;

public class UserProxy2 extends User {

    @Override
    public void buyBreakfast(String name) {
        long startTime = System.currentTimeMillis();
        super.buyBreakfast(name); //2. 通过委托类对象（父类对象）调用委托类的方法
        long endTime = System.currentTimeMillis();
        long cost = endTime - startTime;
        System.out.println("购买" + name + "花费的时间为：" + cost);
    }

    @Override
    public void buyLunch(String name) {
        long startTime = System.currentTimeMillis();
        super.buyLunch(name);
        long endTime = System.currentTimeMillis();
        long cost = endTime - startTime;
        System.out.println("购买" + name + "花费的时间为：" + cost);
    }

    @Override
    public void buyDinner(String name){
        super.buyDinner(name);
    }


    @Override
    public String study(String name1,String name2){
        return super.study(name1,name2);
    }
}
